import { ref, reactive } from 'vue'
import { ROLE_STATUS } from '@/utils/dictionary.js'

export const form = reactive({
  userForm: {
    roleName: null,
    remark: null,
    code: null,
    status: 1
  },
  userRules: {
    roleName: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
    code: [{ required: true, message: '请输入角色编码', trigger: 'blur' }]
  },
  formItem: [
    { type: 'input', key: 'roleName', label: '角色名称', props: { maxlength: '20', placeholder: '请输入角色名称', clearable: true }},
    { type: 'input', key: 'code', label: '角色编码', props: { maxlength: '20', placeholder: '请输入角色编码', clearable: true }},
    { type: 'radio', key: 'status', label: '角色状态', options: ROLE_STATUS },
    { type: 'input', key: 'remark', label: '备注', props: { type: 'textarea', maxlength: '140', autosize: { minRows: 3, maxRows: 3 }, placeholder: '请输入备注', clearable: true }}
  ]
})
